package com.tqw.shipping.controller;

import com.tqw.entity.Result;
import com.tqw.shipping.pojo.Area;
import com.tqw.shipping.service.AreaService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Author: czm
 * @Date: 2022/04/07/14:06
 * @Description:
 */
@RestController
@RequestMapping("/shipping")
public class AreaController {

    @Autowired
    private AreaService areaService;

    /**
     * 获取四级联动的全部省市区街道信息
     * @return
     */
    @GetMapping("/allArea")
    public Result<List<Area>> getAllArea(){
        List<Area> allArea = areaService.getAllArea();
        Result<List<Area>> areaResult = new Result<>();
        areaResult.setData(allArea);
        return areaResult;
    }

}
